package com.android.client.presenter;

import java.util.HashMap;

public class PresenterManager extends HashMap<String,AbstractPresenter>{

	private static final long serialVersionUID = 1L;
	
	private static PresenterManager pm;
	
	private PresenterManager(){
		
	}
	
	public static PresenterManager getInstance(){
		if(pm == null){
			pm = new  PresenterManager();
		}
		return pm;
	}
	
	public void AddPresenter(String key,AbstractPresenter value){
		put(key, value);
	}
	
	@SuppressWarnings("unchecked")
	public <T extends AbstractPresenter> T findPresenter(String key){
		return (T) get(key);
	}
}
